function AdaBoost(feature, label)


%%%% Initialization
%%[feature_number , example_number] = size(feature);

label_number = length(label);

negative_number = length(find(label == 0));
positive_number = length(find(laebl == 1));

weight = ones(1 , example_number);

weight(find(label == 0)) = (1/(2*negative_numer)) * ones(1 , negative_numebr);
weight(find(label == 1)) = (1/(2*positive_numer)) * ones(1 , positive_numebr);

for t = 1:T
    
    % normalization
    
    sum_weight = sum(weight);
    weight_temp = weight./sum_weight;
    weight = weight_temp;
    
    for j = 1: feature_number
        
        current_feature = read_feature(j);
        
        [current_error , current_threshold , current_parity] = weak_classifier(current_feature);
        
        error(j) = current_error;
        threshold(j) = current_threshold;
        parity(j) = current_parity;
        
    end


    [error_rank , error_index] = sort(error, 'ascend');
        
    h_index(t) = error_index(1); % choose the classifier
        
        %%  Update the weights
     beta(t) = error_rank(1)/( 1 - error_rank(1));
        
     for i = 1:example_number
            
         if (current_feature(i) * current_parity < current_threshold * current_parity ...
             && label(i) == 1 ) || ( current_feature(i) * current_parity < current_threshold * current_parity ...
             && label(i) == 0 ) % corrent classification
         
             weight(i) = weight(i) * beta(t);
         
         end
     end
     
end


     
                
                
                
        
        
        
        
        
    
    
